import { createRouter, createWebHistory } from 'vue-router'

import Home from '@/views/home/index.vue'
import Index from '@/views/home/home.vue'
import cart from '@/views/home/cart.vue'
import cal from '@/views/home/cal.vue'
import my from '@/views/home/my.vue'
import search from '@/views/search/index.vue'
import detail from '@/views/detail/index.vue'
import zhuce from '@/views/zhuce/index.vue'
import login from '@/views/login/index.vue'



const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: Home,children:[
        { path: 'Index', component: Index,},
        { path: 'cart', component: cart,},
        { path: 'cal', component: cal,},
        { path: 'my', component: my,},
      ]
    },
    {
      path: '/search',
      name: 'search',
      component: search,
    },
    {
      path: '/detail/:goods_id',
      name: 'detail',
      component: detail,
    },
    {
      path: '/zhuce',
      name: 'zhuce',
      component: zhuce,
    },
    {
      path: '/login',
      name: 'login',
      component: login,
    },
 
   
   
  ],
})

export default router
